function t(t) {
    n.sendrequest("posterapi/getfrendlist", "POST", {
        token: t,
        page: o
    }, function(t) {
        1 == t.status && e.setData({
            hotlist: e.data.hotlist.concat(t.data)
        });
    });
}

var e, a, n = require("../../utils/util.js"), o = 1, s = getApp().globalData.url.imgurl;

Page({
    data: {
        hotlist: new Array(),
        imgurl: s
    },
    onLoad: function(s) {
        e = this, n.getToken(function(t) {
            a = t;
        }), n.sendrequest("posterapi/getbanner", "POST", {
            token: a
        }, function(n) {
            1 == n.status && e.setData({
                bannerlist: n.data
            }), o = 1, t(a);
        });
    },
    onShow: function() {},
    onShareAppMessage: function(t) {
        return {
            title: "小婷海报",
            path: "pages/hot/hot",
            success: function(t) {},
            fail: function(t) {}
        };
    },
    onadapter: function(t) {
        if (t.currentTarget.dataset.url) if (t.currentTarget.dataset.url.indexOf("?is_bottom=1") > 0) {
            var e = t.currentTarget.dataset.url.split("?is_bottom=1");
            wx.switchTab({
                url: e[0]
            });
        } else wx.navigateTo({
            url: t.currentTarget.dataset.url
        });
    },
    saveimg: function(t) {
        wx.showActionSheet({
            itemList: [ "保存到相册" ],
            success: function(e) {
                wx.showLoading({
                    title: "保存中"
                }), wx.downloadFile({
                    url: s + t.detail.target.dataset.url,
                    success: function(t) {
                        wx.hideLoading(), 200 === t.statusCode && wx.saveImageToPhotosAlbum({
                            filePath: t.tempFilePath,
                            success: function() {
                                wx.showToast({
                                    title: "已保存"
                                });
                            }
                        });
                    }
                });
            },
            fail: function(t) {}
        }), n.getToken(function(e) {
            n.sendrequest("posterapi/setfrom", "POST", {
                token: e,
                formid: t.detail.formId
            }, function(t) {});
        });
    },
    collect: function(t) {
        n.addcollect(t.currentTarget.dataset.id);
    },
    copytext: function(t) {
        t.currentTarget.dataset.text && wx.setClipboardData({
            data: t.currentTarget.dataset.text,
            success: function(t) {
                wx.showToast({
                    title: "复制成功",
                    icon: "success",
                    duration: 2e3
                });
            }
        });
    },
    redirtbyid: function(t) {
        wx.navigateTo({
            url: "/pages/poster/poster?micro_id=" + t.detail.target.dataset.id
        }), n.getToken(function(e) {
            n.sendrequest("posterapi/setfrom", "POST", {
                token: e,
                formid: t.detail.formId
            }, function(t) {});
        });
    },
    onReachBottom: function() {
        o += 1, t(a);
    }
});